import axios from 'axios'

export const pendingList: IAnyObject[] = []
export const cancelToken = axios.CancelToken
export const removePending = (config: IAnyObject): void => {
  for (const pendingIndex in pendingList) {
    if (pendingList[pendingIndex].u === `${config.url}&${config.method}`) {
      pendingList[pendingIndex].f()
      pendingList.splice(+pendingIndex, 1)
    }
  }
}
export default axios
